<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /usr/include/sys/resource.h</title>
  </head>
  <body>
    <h1>File: /usr/include/sys/resource.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="k">/*</span>
<a name="2" /><span class="True">       2:</span> <span class="k"> * Copyright (c) 2000-2008 Apple Inc. All rights reserved.</span>
<a name="3" /><span class="True">       3:</span> <span class="k"> *</span>
<a name="4" /><span class="True">       4:</span> <span class="k"> * @APPLE_OSREFERENCE_LICENSE_HEADER_START@</span>
<a name="5" /><span class="True">       5:</span> <span class="k"> * </span>
<a name="6" /><span class="True">       6:</span> <span class="k"> * This file contains Original Code and/or Modifications of Original Code</span>
<a name="7" /><span class="True">       7:</span> <span class="k"> * as defined in and that are subject to the Apple Public Source License</span>
<a name="8" /><span class="True">       8:</span> <span class="k"> * Version 2.0 (the &apos;License&apos;). You may not use this file except in</span>
<a name="9" /><span class="True">       9:</span> <span class="k"> * compliance with the License. The rights granted to you under the License</span>
<a name="10" /><span class="True">      10:</span> <span class="k"> * may not be used to create, or enable the creation or redistribution of,</span>
<a name="11" /><span class="True">      11:</span> <span class="k"> * unlawful or unlicensed copies of an Apple operating system, or to</span>
<a name="12" /><span class="True">      12:</span> <span class="k"> * circumvent, violate, or enable the circumvention or violation of, any</span>
<a name="13" /><span class="True">      13:</span> <span class="k"> * terms of an Apple operating system software license agreement.</span>
<a name="14" /><span class="True">      14:</span> <span class="k"> * </span>
<a name="15" /><span class="True">      15:</span> <span class="k"> * Please obtain a copy of the License at</span>
<a name="16" /><span class="True">      16:</span> <span class="k"> * http://www.opensource.apple.com/apsl/ and read it before using this file.</span>
<a name="17" /><span class="True">      17:</span> <span class="k"> * </span>
<a name="18" /><span class="True">      18:</span> <span class="k"> * The Original Code and all software distributed under the License are</span>
<a name="19" /><span class="True">      19:</span> <span class="k"> * distributed on an &apos;AS IS&apos; basis, WITHOUT WARRANTY OF ANY KIND, EITHER</span>
<a name="20" /><span class="True">      20:</span> <span class="k"> * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,</span>
<a name="21" /><span class="True">      21:</span> <span class="k"> * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,</span>
<a name="22" /><span class="True">      22:</span> <span class="k"> * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.</span>
<a name="23" /><span class="True">      23:</span> <span class="k"> * Please see the License for the specific language governing rights and</span>
<a name="24" /><span class="True">      24:</span> <span class="k"> * limitations under the License.</span>
<a name="25" /><span class="True">      25:</span> <span class="k"> * </span>
<a name="26" /><span class="True">      26:</span> <span class="k"> * @APPLE_OSREFERENCE_LICENSE_HEADER_END@</span>
<a name="27" /><span class="True">      27:</span> <span class="k"> */</span>
<a name="28" /><span class="True">      28:</span> <span class="k">/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */</span>
<a name="29" /><span class="True">      29:</span> <span class="k">/*</span>
<a name="30" /><span class="True">      30:</span> <span class="k"> * Copyright (c) 1982, 1986, 1993</span>
<a name="31" /><span class="True">      31:</span> <span class="k"> *    The Regents of the University of California.  All rights reserved.</span>
<a name="32" /><span class="True">      32:</span> <span class="k"> *</span>
<a name="33" /><span class="True">      33:</span> <span class="k"> * Redistribution and use in source and binary forms, with or without</span>
<a name="34" /><span class="True">      34:</span> <span class="k"> * modification, are permitted provided that the following conditions</span>
<a name="35" /><span class="True">      35:</span> <span class="k"> * are met:</span>
<a name="36" /><span class="True">      36:</span> <span class="k"> * 1. Redistributions of source code must retain the above copyright</span>
<a name="37" /><span class="True">      37:</span> <span class="k"> *    notice, this list of conditions and the following disclaimer.</span>
<a name="38" /><span class="True">      38:</span> <span class="k"> * 2. Redistributions in binary form must reproduce the above copyright</span>
<a name="39" /><span class="True">      39:</span> <span class="k"> *    notice, this list of conditions and the following disclaimer in the</span>
<a name="40" /><span class="True">      40:</span> <span class="k"> *    documentation and/or other materials provided with the distribution.</span>
<a name="41" /><span class="True">      41:</span> <span class="k"> * 3. All advertising materials mentioning features or use of this software</span>
<a name="42" /><span class="True">      42:</span> <span class="k"> *    must display the following acknowledgement:</span>
<a name="43" /><span class="True">      43:</span> <span class="k"> *    This product includes software developed by the University of</span>
<a name="44" /><span class="True">      44:</span> <span class="k"> *    California, Berkeley and its contributors.</span>
<a name="45" /><span class="True">      45:</span> <span class="k"> * 4. Neither the name of the University nor the names of its contributors</span>
<a name="46" /><span class="True">      46:</span> <span class="k"> *    may be used to endorse or promote products derived from this software</span>
<a name="47" /><span class="True">      47:</span> <span class="k"> *    without specific prior written permission.</span>
<a name="48" /><span class="True">      48:</span> <span class="k"> *</span>
<a name="49" /><span class="True">      49:</span> <span class="k"> * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS&apos;&apos; AND</span>
<a name="50" /><span class="True">      50:</span> <span class="k"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
<a name="51" /><span class="True">      51:</span> <span class="k"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
<a name="52" /><span class="True">      52:</span> <span class="k"> * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE</span>
<a name="53" /><span class="True">      53:</span> <span class="k"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
<a name="54" /><span class="True">      54:</span> <span class="k"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
<a name="55" /><span class="True">      55:</span> <span class="k"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
<a name="56" /><span class="True">      56:</span> <span class="k"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
<a name="57" /><span class="True">      57:</span> <span class="k"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
<a name="58" /><span class="True">      58:</span> <span class="k"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
<a name="59" /><span class="True">      59:</span> <span class="k"> * SUCH DAMAGE.</span>
<a name="60" /><span class="True">      60:</span> <span class="k"> *</span>
<a name="61" /><span class="True">      61:</span> <span class="k"> *    @(#)resource.h    8.2 (Berkeley) 1/4/94</span>
<a name="62" /><span class="True">      62:</span> <span class="k"> */</span>
<a name="63" /><span class="True">      63:</span> 
<a name="64" /><span class="True">      64:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_noref.html#_X1NZU19SRVNPVVJDRV9IX18w"><span class="b">_SYS_RESOURCE_H_</span></a>
<a name="65" /><span class="True">      65:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_X1NZU19SRVNPVVJDRV9IX18w"><span class="b">_SYS_RESOURCE_H_</span></a>
<a name="66" /><span class="True">      66:</span> 
<a name="67" /><span class="True">      67:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">appleapiopts</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="68" /><span class="True">      68:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">cdefs</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="69" /><span class="True">      69:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">_types</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="70" /><span class="True">      70:</span> 
<a name="71" /><span class="True">      71:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="72" /><span class="True">      72:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">stdint</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="73" /><span class="True">      73:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="74" /><span class="True">      74:</span> 
<a name="75" /><span class="True">      75:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">Availability</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="76" /><span class="True">      76:</span> 
<a name="77" /><span class="True">      77:</span> <span class="k">/* [XSI] The timeval structure shall be defined as described in</span>
<a name="78" /><span class="True">      78:</span> <span class="k"> * &lt;sys/time.h&gt;</span>
<a name="79" /><span class="True">      79:</span> <span class="k"> */</span>
<a name="80" /><span class="True">      80:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">_types</span><span class="f">/</span><span class="b">_timeval</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="81" /><span class="True">      81:</span> 
<a name="82" /><span class="True">      82:</span> <span class="k">/* The id_t type shall be defined as described in &lt;sys/types.h&gt; */</span>
<a name="83" /><span class="True">      83:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">sys</span><span class="f">/</span><span class="b">_types</span><span class="f">/</span><span class="b">_id_t</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="84" /><span class="True">      84:</span> 
<a name="85" /><span class="True">      85:</span> 
<a name="86" /><span class="True">      86:</span> <span class="k">/*</span>
<a name="87" /><span class="True">      87:</span> <span class="k"> * Resource limit type (low 63 bits, excluding the sign bit)</span>
<a name="88" /><span class="True">      88:</span> <span class="k"> */</span>
<a name="89" /><span class="True">      89:</span> <span class="m">typedef</span> <span class="b">__uint64_t</span>    <span class="b">rlim_t</span><span class="f">;</span>
<a name="90" /><span class="True">      90:</span> 
<a name="91" /><span class="True">      91:</span> 
<a name="92" /><span class="True">      92:</span> <span class="k">/*****</span>
<a name="93" /><span class="True">      93:</span> <span class="k"> * PRIORITY</span>
<a name="94" /><span class="True">      94:</span> <span class="k"> */</span>
<a name="95" /><span class="True">      95:</span> 
<a name="96" /><span class="True">      96:</span> <span class="k">/*</span>
<a name="97" /><span class="True">      97:</span> <span class="k"> * Possible values of the first parameter to getpriority()/setpriority(),</span>
<a name="98" /><span class="True">      98:</span> <span class="k"> * used to indicate the type of the second parameter.</span>
<a name="99" /><span class="True">      99:</span> <span class="k"> */</span>
<a name="100" /><span class="True">     100:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19QUk9DRVNTXzA_"><span class="b">PRIO_PROCESS</span></a>    <span class="c">0</span>        <span class="k">/* Second argument is a PID */</span>
<a name="101" /><span class="True">     101:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19QR1JQXzA_"><span class="b">PRIO_PGRP</span></a>    <span class="c">1</span>        <span class="k">/* Second argument is a GID */</span>
<a name="102" /><span class="True">     102:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19VU0VSXzA_"><span class="b">PRIO_USER</span></a>    <span class="c">2</span>        <span class="k">/* Second argument is a UID */</span>
<a name="103" /><span class="True">     103:</span> 
<a name="104" /><span class="True">     104:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="105" /><span class="True">     105:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19EQVJXSU5fVEhSRUFEXzA_"><span class="b">PRIO_DARWIN_THREAD</span></a>    <span class="c">3</span>        <span class="k">/* Second argument is always 0 (current thread) */</span>
<a name="106" /><span class="True">     106:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19EQVJXSU5fUFJPQ0VTU18w"><span class="b">PRIO_DARWIN_PROCESS</span></a>    <span class="c">4</span>        <span class="k">/* Second argument is a PID */</span>
<a name="107" /><span class="True">     107:</span> 
<a name="108" /><span class="True">     108:</span> 
<a name="109" /><span class="True">     109:</span> <span class="k">/*</span>
<a name="110" /><span class="True">     110:</span> <span class="k"> * Range limitations for the value of the third parameter to setpriority().</span>
<a name="111" /><span class="True">     111:</span> <span class="k"> */</span>
<a name="112" /><span class="True">     112:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19NSU5fMA__"><span class="b">PRIO_MIN</span></a>    <span class="f">-</span><span class="c">20</span>
<a name="113" /><span class="True">     113:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UFJJT19NQVhfMA__"><span class="b">PRIO_MAX</span></a>    <span class="c">20</span>
<a name="114" /><span class="True">     114:</span> 
<a name="115" /><span class="True">     115:</span> <span class="k">/* </span>
<a name="116" /><span class="True">     116:</span> <span class="k"> * use PRIO_DARWIN_BG to set the current thread into &quot;background&quot; state</span>
<a name="117" /><span class="True">     117:</span> <span class="k"> * which lowers CPU, disk IO, and networking priorites until thread terminates</span>
<a name="118" /><span class="True">     118:</span> <span class="k"> * or &quot;background&quot; state is revoked</span>
<a name="119" /><span class="True">     119:</span> <span class="k"> */</span>
<a name="120" /><span class="True">     120:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFJJT19EQVJXSU5fQkdfMA__"><span class="b">PRIO_DARWIN_BG</span></a> <span class="c">0x1000</span>
<a name="121" /><span class="True">     121:</span> 
<a name="122" /><span class="True">     122:</span> <span class="k">/*</span>
<a name="123" /><span class="True">     123:</span> <span class="k"> * use PRIO_DARWIN_NONUI to restrict a process&apos;s ability to make calls to</span>
<a name="124" /><span class="True">     124:</span> <span class="k"> * the GPU. (deprecated)</span>
<a name="125" /><span class="True">     125:</span> <span class="k"> */</span>
<a name="126" /><span class="True">     126:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UFJJT19EQVJXSU5fTk9OVUlfMA__"><span class="b">PRIO_DARWIN_NONUI</span></a> <span class="c">0x1001</span>
<a name="127" /><span class="True">     127:</span> 
<a name="128" /><span class="True">     128:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="129" /><span class="True">     129:</span> 
<a name="130" /><span class="True">     130:</span> 
<a name="131" /><span class="True">     131:</span> 
<a name="132" /><span class="True">     132:</span> <span class="k">/*****</span>
<a name="133" /><span class="True">     133:</span> <span class="k"> * RESOURCE USAGE</span>
<a name="134" /><span class="True">     134:</span> <span class="k"> */</span>
<a name="135" /><span class="True">     135:</span> 
<a name="136" /><span class="True">     136:</span> <span class="k">/*</span>
<a name="137" /><span class="True">     137:</span> <span class="k"> * Possible values of the first parameter to getrusage(), used to indicate</span>
<a name="138" /><span class="True">     138:</span> <span class="k"> * the scope of the information to be returned.</span>
<a name="139" /><span class="True">     139:</span> <span class="k"> */</span>
<a name="140" /><span class="True">     140:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UlVTQUdFX1NFTEZfMA__"><span class="b">RUSAGE_SELF</span></a>    <span class="c">0</span>        <span class="k">/* Current process information */</span>
<a name="141" /><span class="True">     141:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UlVTQUdFX0NISUxEUkVOXzA_"><span class="b">RUSAGE_CHILDREN</span></a>    <span class="f">-</span><span class="c">1</span>        <span class="k">/* Current process&apos; children */</span>
<a name="142" /><span class="True">     142:</span> 
<a name="143" /><span class="True">     143:</span> <span class="k">/*</span>
<a name="144" /><span class="True">     144:</span> <span class="k"> * A structure representing an accounting of resource utilization.  The</span>
<a name="145" /><span class="True">     145:</span> <span class="k"> * address of an instance of this structure is the second parameter to</span>
<a name="146" /><span class="True">     146:</span> <span class="k"> * getrusage().</span>
<a name="147" /><span class="True">     147:</span> <span class="k"> *</span>
<a name="148" /><span class="True">     148:</span> <span class="k"> * Note: All values other than ru_utime and ru_stime are implementaiton</span>
<a name="149" /><span class="True">     149:</span> <span class="k"> *       defined and subject to change in a future release.  Their use</span>
<a name="150" /><span class="True">     150:</span> <span class="k"> *       is discouraged for standards compliant programs.</span>
<a name="151" /><span class="True">     151:</span> <span class="k"> */</span>
<a name="152" /><span class="True">     152:</span> <span class="m">struct</span>    <span class="b">rusage</span> <span class="f">{</span>
<a name="153" /><span class="True">     153:</span>     <span class="m">struct</span> <span class="b">timeval</span> <span class="b">ru_utime</span><span class="f">;</span>    <span class="k">/* user time used (PL) */</span>
<a name="154" /><span class="True">     154:</span>     <span class="m">struct</span> <span class="b">timeval</span> <span class="b">ru_stime</span><span class="f">;</span>    <span class="k">/* system time used (PL) */</span>
<a name="155" /><span class="False">     155:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&lt;</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="156" /><span class="False">     156:</span>     <span class="m">long</span>    <span class="b">ru_opaque</span><span class="f">[</span><span class="c">14</span><span class="f">]</span><span class="f">;</span>        <span class="k">/* implementation defined */</span>
<a name="157" /><span class="True">     157:</span> <span class="f">#</span><span class="n">else</span>
<a name="158" /><span class="True">     158:</span>     <span class="k">/*</span>
<a name="159" /><span class="True">     159:</span> <span class="k">     * Informational aliases for source compatibility with programs</span>
<a name="160" /><span class="True">     160:</span> <span class="k">     * that need more information than that provided by standards,</span>
<a name="161" /><span class="True">     161:</span> <span class="k">     * and which do not mind being OS-dependent.</span>
<a name="162" /><span class="True">     162:</span> <span class="k">     */</span>
<a name="163" /><span class="True">     163:</span>     <span class="m">long</span>    <span class="b">ru_maxrss</span><span class="f">;</span>        <span class="k">/* max resident set size (PL) */</span>
<a name="164" /><span class="True">     164:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_cnVfZmlyc3RfMA__"><span class="b">ru_first</span></a>    <span class="b">ru_ixrss</span>    <span class="k">/* internal: ruadd() range start */</span>
<a name="165" /><span class="True">     165:</span>     <span class="m">long</span>    <span class="b">ru_ixrss</span><span class="f">;</span>        <span class="k">/* integral shared memory size (NU) */</span>
<a name="166" /><span class="True">     166:</span>     <span class="m">long</span>    <span class="b">ru_idrss</span><span class="f">;</span>        <span class="k">/* integral unshared data (NU)  */</span>
<a name="167" /><span class="True">     167:</span>     <span class="m">long</span>    <span class="b">ru_isrss</span><span class="f">;</span>        <span class="k">/* integral unshared stack (NU) */</span>
<a name="168" /><span class="True">     168:</span>     <span class="m">long</span>    <span class="b">ru_minflt</span><span class="f">;</span>        <span class="k">/* page reclaims (NU) */</span>
<a name="169" /><span class="True">     169:</span>     <span class="m">long</span>    <span class="b">ru_majflt</span><span class="f">;</span>        <span class="k">/* page faults (NU) */</span>
<a name="170" /><span class="True">     170:</span>     <span class="m">long</span>    <span class="b">ru_nswap</span><span class="f">;</span>        <span class="k">/* swaps (NU) */</span>
<a name="171" /><span class="True">     171:</span>     <span class="m">long</span>    <span class="b">ru_inblock</span><span class="f">;</span>        <span class="k">/* block input operations (atomic) */</span>
<a name="172" /><span class="True">     172:</span>     <span class="m">long</span>    <span class="b">ru_oublock</span><span class="f">;</span>        <span class="k">/* block output operations (atomic) */</span>
<a name="173" /><span class="True">     173:</span>     <span class="m">long</span>    <span class="b">ru_msgsnd</span><span class="f">;</span>        <span class="k">/* messages sent (atomic) */</span>
<a name="174" /><span class="True">     174:</span>     <span class="m">long</span>    <span class="b">ru_msgrcv</span><span class="f">;</span>        <span class="k">/* messages received (atomic) */</span>
<a name="175" /><span class="True">     175:</span>     <span class="m">long</span>    <span class="b">ru_nsignals</span><span class="f">;</span>        <span class="k">/* signals received (atomic) */</span>
<a name="176" /><span class="True">     176:</span>     <span class="m">long</span>    <span class="b">ru_nvcsw</span><span class="f">;</span>        <span class="k">/* voluntary context switches (atomic) */</span>
<a name="177" /><span class="True">     177:</span>     <span class="m">long</span>    <span class="b">ru_nivcsw</span><span class="f">;</span>        <span class="k">/* involuntary &quot; */</span>
<a name="178" /><span class="True">     178:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_cnVfbGFzdF8w"><span class="b">ru_last</span></a>        <span class="b">ru_nivcsw</span>    <span class="k">/* internal: ruadd() range end */</span>
<a name="179" /><span class="True">     179:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="180" /><span class="True">     180:</span> <span class="f">}</span><span class="f">;</span>
<a name="181" /><span class="True">     181:</span> 
<a name="182" /><span class="True">     182:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="183" /><span class="True">     183:</span> <span class="k">/*</span>
<a name="184" /><span class="True">     184:</span> <span class="k"> * Flavors for proc_pid_rusage().</span>
<a name="185" /><span class="True">     185:</span> <span class="k"> */</span>
<a name="186" /><span class="True">     186:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UlVTQUdFX0lORk9fVjBfMA__"><span class="b">RUSAGE_INFO_V0</span></a>    <span class="c">0</span>
<a name="187" /><span class="True">     187:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UlVTQUdFX0lORk9fVjFfMA__"><span class="b">RUSAGE_INFO_V1</span></a>    <span class="c">1</span>
<a name="188" /><span class="True">     188:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UlVTQUdFX0lORk9fVjJfMA__"><span class="b">RUSAGE_INFO_V2</span></a>    <span class="c">2</span>
<a name="189" /><span class="True">     189:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UlVTQUdFX0lORk9fVjNfMA__"><span class="b">RUSAGE_INFO_V3</span></a>    <span class="c">3</span>
<a name="190" /><span class="True">     190:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UlVTQUdFX0lORk9fQ1VSUkVOVF8w"><span class="b">RUSAGE_INFO_CURRENT</span></a> <a href="macros_noref.html#_UlVTQUdFX0lORk9fVjNfMA__"><span class="b">RUSAGE_INFO_V3</span></a>
<a name="191" /><span class="True">     191:</span> 
<a name="192" /><span class="True">     192:</span> <span class="m">typedef</span> <span class="m">void</span> <span class="f">*</span><span class="b">rusage_info_t</span><span class="f">;</span>
<a name="193" /><span class="True">     193:</span> 
<a name="194" /><span class="True">     194:</span> <span class="m">struct</span> <span class="b">rusage_info_v0</span> <span class="f">{</span>
<a name="195" /><span class="True">     195:</span>     <span class="b">uint8_t</span>  <span class="b">ri_uuid</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="196" /><span class="True">     196:</span>     <span class="b">uint64_t</span> <span class="b">ri_user_time</span><span class="f">;</span>
<a name="197" /><span class="True">     197:</span>     <span class="b">uint64_t</span> <span class="b">ri_system_time</span><span class="f">;</span>
<a name="198" /><span class="True">     198:</span>     <span class="b">uint64_t</span> <span class="b">ri_pkg_idle_wkups</span><span class="f">;</span>
<a name="199" /><span class="True">     199:</span>     <span class="b">uint64_t</span> <span class="b">ri_interrupt_wkups</span><span class="f">;</span>
<a name="200" /><span class="True">     200:</span>     <span class="b">uint64_t</span> <span class="b">ri_pageins</span><span class="f">;</span>
<a name="201" /><span class="True">     201:</span>     <span class="b">uint64_t</span> <span class="b">ri_wired_size</span><span class="f">;</span>
<a name="202" /><span class="True">     202:</span>     <span class="b">uint64_t</span> <span class="b">ri_resident_size</span><span class="f">;</span>    
<a name="203" /><span class="True">     203:</span>     <span class="b">uint64_t</span> <span class="b">ri_phys_footprint</span><span class="f">;</span>
<a name="204" /><span class="True">     204:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_start_abstime</span><span class="f">;</span>
<a name="205" /><span class="True">     205:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_exit_abstime</span><span class="f">;</span>
<a name="206" /><span class="True">     206:</span> <span class="f">}</span><span class="f">;</span>
<a name="207" /><span class="True">     207:</span> 
<a name="208" /><span class="True">     208:</span> <span class="m">struct</span> <span class="b">rusage_info_v1</span> <span class="f">{</span>
<a name="209" /><span class="True">     209:</span>     <span class="b">uint8_t</span>  <span class="b">ri_uuid</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="210" /><span class="True">     210:</span>     <span class="b">uint64_t</span> <span class="b">ri_user_time</span><span class="f">;</span>
<a name="211" /><span class="True">     211:</span>     <span class="b">uint64_t</span> <span class="b">ri_system_time</span><span class="f">;</span>
<a name="212" /><span class="True">     212:</span>     <span class="b">uint64_t</span> <span class="b">ri_pkg_idle_wkups</span><span class="f">;</span>
<a name="213" /><span class="True">     213:</span>     <span class="b">uint64_t</span> <span class="b">ri_interrupt_wkups</span><span class="f">;</span>
<a name="214" /><span class="True">     214:</span>     <span class="b">uint64_t</span> <span class="b">ri_pageins</span><span class="f">;</span>
<a name="215" /><span class="True">     215:</span>     <span class="b">uint64_t</span> <span class="b">ri_wired_size</span><span class="f">;</span>
<a name="216" /><span class="True">     216:</span>     <span class="b">uint64_t</span> <span class="b">ri_resident_size</span><span class="f">;</span>    
<a name="217" /><span class="True">     217:</span>     <span class="b">uint64_t</span> <span class="b">ri_phys_footprint</span><span class="f">;</span>
<a name="218" /><span class="True">     218:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_start_abstime</span><span class="f">;</span>
<a name="219" /><span class="True">     219:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_exit_abstime</span><span class="f">;</span>
<a name="220" /><span class="True">     220:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_user_time</span><span class="f">;</span>
<a name="221" /><span class="True">     221:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_system_time</span><span class="f">;</span>
<a name="222" /><span class="True">     222:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_pkg_idle_wkups</span><span class="f">;</span>
<a name="223" /><span class="True">     223:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_interrupt_wkups</span><span class="f">;</span>
<a name="224" /><span class="True">     224:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_pageins</span><span class="f">;</span>
<a name="225" /><span class="True">     225:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_elapsed_abstime</span><span class="f">;</span>
<a name="226" /><span class="True">     226:</span> <span class="f">}</span><span class="f">;</span>
<a name="227" /><span class="True">     227:</span> 
<a name="228" /><span class="True">     228:</span> <span class="m">struct</span> <span class="b">rusage_info_v2</span> <span class="f">{</span>
<a name="229" /><span class="True">     229:</span>     <span class="b">uint8_t</span>  <span class="b">ri_uuid</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="230" /><span class="True">     230:</span>     <span class="b">uint64_t</span> <span class="b">ri_user_time</span><span class="f">;</span>
<a name="231" /><span class="True">     231:</span>     <span class="b">uint64_t</span> <span class="b">ri_system_time</span><span class="f">;</span>
<a name="232" /><span class="True">     232:</span>     <span class="b">uint64_t</span> <span class="b">ri_pkg_idle_wkups</span><span class="f">;</span>
<a name="233" /><span class="True">     233:</span>     <span class="b">uint64_t</span> <span class="b">ri_interrupt_wkups</span><span class="f">;</span>
<a name="234" /><span class="True">     234:</span>     <span class="b">uint64_t</span> <span class="b">ri_pageins</span><span class="f">;</span>
<a name="235" /><span class="True">     235:</span>     <span class="b">uint64_t</span> <span class="b">ri_wired_size</span><span class="f">;</span>
<a name="236" /><span class="True">     236:</span>     <span class="b">uint64_t</span> <span class="b">ri_resident_size</span><span class="f">;</span>    
<a name="237" /><span class="True">     237:</span>     <span class="b">uint64_t</span> <span class="b">ri_phys_footprint</span><span class="f">;</span>
<a name="238" /><span class="True">     238:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_start_abstime</span><span class="f">;</span>
<a name="239" /><span class="True">     239:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_exit_abstime</span><span class="f">;</span>
<a name="240" /><span class="True">     240:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_user_time</span><span class="f">;</span>
<a name="241" /><span class="True">     241:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_system_time</span><span class="f">;</span>
<a name="242" /><span class="True">     242:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_pkg_idle_wkups</span><span class="f">;</span>
<a name="243" /><span class="True">     243:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_interrupt_wkups</span><span class="f">;</span>
<a name="244" /><span class="True">     244:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_pageins</span><span class="f">;</span>
<a name="245" /><span class="True">     245:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_elapsed_abstime</span><span class="f">;</span>
<a name="246" /><span class="True">     246:</span>     <span class="b">uint64_t</span> <span class="b">ri_diskio_bytesread</span><span class="f">;</span>
<a name="247" /><span class="True">     247:</span>     <span class="b">uint64_t</span> <span class="b">ri_diskio_byteswritten</span><span class="f">;</span>
<a name="248" /><span class="True">     248:</span> <span class="f">}</span><span class="f">;</span>
<a name="249" /><span class="True">     249:</span> 
<a name="250" /><span class="True">     250:</span> <span class="m">struct</span> <span class="b">rusage_info_v3</span> <span class="f">{</span>
<a name="251" /><span class="True">     251:</span>     <span class="b">uint8_t</span>  <span class="b">ri_uuid</span><span class="f">[</span><span class="c">16</span><span class="f">]</span><span class="f">;</span>
<a name="252" /><span class="True">     252:</span>     <span class="b">uint64_t</span> <span class="b">ri_user_time</span><span class="f">;</span>
<a name="253" /><span class="True">     253:</span>     <span class="b">uint64_t</span> <span class="b">ri_system_time</span><span class="f">;</span>
<a name="254" /><span class="True">     254:</span>     <span class="b">uint64_t</span> <span class="b">ri_pkg_idle_wkups</span><span class="f">;</span>
<a name="255" /><span class="True">     255:</span>     <span class="b">uint64_t</span> <span class="b">ri_interrupt_wkups</span><span class="f">;</span>
<a name="256" /><span class="True">     256:</span>     <span class="b">uint64_t</span> <span class="b">ri_pageins</span><span class="f">;</span>
<a name="257" /><span class="True">     257:</span>     <span class="b">uint64_t</span> <span class="b">ri_wired_size</span><span class="f">;</span>
<a name="258" /><span class="True">     258:</span>     <span class="b">uint64_t</span> <span class="b">ri_resident_size</span><span class="f">;</span>    
<a name="259" /><span class="True">     259:</span>     <span class="b">uint64_t</span> <span class="b">ri_phys_footprint</span><span class="f">;</span>
<a name="260" /><span class="True">     260:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_start_abstime</span><span class="f">;</span>
<a name="261" /><span class="True">     261:</span>     <span class="b">uint64_t</span> <span class="b">ri_proc_exit_abstime</span><span class="f">;</span>
<a name="262" /><span class="True">     262:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_user_time</span><span class="f">;</span>
<a name="263" /><span class="True">     263:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_system_time</span><span class="f">;</span>
<a name="264" /><span class="True">     264:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_pkg_idle_wkups</span><span class="f">;</span>
<a name="265" /><span class="True">     265:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_interrupt_wkups</span><span class="f">;</span>
<a name="266" /><span class="True">     266:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_pageins</span><span class="f">;</span>
<a name="267" /><span class="True">     267:</span>     <span class="b">uint64_t</span> <span class="b">ri_child_elapsed_abstime</span><span class="f">;</span>
<a name="268" /><span class="True">     268:</span>     <span class="b">uint64_t</span> <span class="b">ri_diskio_bytesread</span><span class="f">;</span>
<a name="269" /><span class="True">     269:</span>     <span class="b">uint64_t</span> <span class="b">ri_diskio_byteswritten</span><span class="f">;</span>
<a name="270" /><span class="True">     270:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_default</span><span class="f">;</span>
<a name="271" /><span class="True">     271:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_maintenance</span><span class="f">;</span>
<a name="272" /><span class="True">     272:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_background</span><span class="f">;</span>
<a name="273" /><span class="True">     273:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_utility</span><span class="f">;</span>
<a name="274" /><span class="True">     274:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_legacy</span><span class="f">;</span>
<a name="275" /><span class="True">     275:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_user_initiated</span><span class="f">;</span>
<a name="276" /><span class="True">     276:</span>     <span class="b">uint64_t</span> <span class="b">ri_cpu_time_qos_user_interactive</span><span class="f">;</span>
<a name="277" /><span class="True">     277:</span>     <span class="b">uint64_t</span> <span class="b">ri_billed_system_time</span><span class="f">;</span>
<a name="278" /><span class="True">     278:</span>     <span class="b">uint64_t</span> <span class="b">ri_serviced_system_time</span><span class="f">;</span>
<a name="279" /><span class="True">     279:</span> <span class="f">}</span><span class="f">;</span>
<a name="280" /><span class="True">     280:</span> 
<a name="281" /><span class="True">     281:</span> <span class="m">typedef</span> <span class="m">struct</span> <span class="b">rusage_info_v3</span> <span class="b">rusage_info_current</span><span class="f">;</span>
<a name="282" /><span class="True">     282:</span> 
<a name="283" /><span class="True">     283:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="284" /><span class="True">     284:</span> 
<a name="285" /><span class="True">     285:</span> 
<a name="286" /><span class="True">     286:</span> 
<a name="287" /><span class="True">     287:</span> <span class="k">/*****</span>
<a name="288" /><span class="True">     288:</span> <span class="k"> * RESOURCE LIMITS</span>
<a name="289" /><span class="True">     289:</span> <span class="k"> */</span>
<a name="290" /><span class="True">     290:</span> 
<a name="291" /><span class="True">     291:</span> <span class="k">/*</span>
<a name="292" /><span class="True">     292:</span> <span class="k"> * Symbolic constants for resource limits; since all limits are representable</span>
<a name="293" /><span class="True">     293:</span> <span class="k"> * as a type rlim_t, we are permitted to define RLIM_SAVED_* in terms of</span>
<a name="294" /><span class="True">     294:</span> <span class="k"> * RLIM_INFINITY.</span>
<a name="295" /><span class="True">     295:</span> <span class="k"> */</span>
<a name="296" /><span class="True">     296:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTV9JTkZJTklUWV8w"><span class="b">RLIM_INFINITY</span></a>    <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">__uint64_t</span><span class="f">)</span><span class="c">1</span> <span class="f">&lt;&lt;</span> <span class="c">63</span><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span>    <span class="k">/* no limit */</span>
<a name="297" /><span class="True">     297:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTV9TQVZFRF9NQVhfMA__"><span class="b">RLIM_SAVED_MAX</span></a>    <a href="macros_noref.html#_UkxJTV9JTkZJTklUWV8w"><span class="b">RLIM_INFINITY</span></a>    <span class="k">/* Unrepresentable hard limit */</span>
<a name="298" /><span class="True">     298:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTV9TQVZFRF9DVVJfMA__"><span class="b">RLIM_SAVED_CUR</span></a>    <a href="macros_noref.html#_UkxJTV9JTkZJTklUWV8w"><span class="b">RLIM_INFINITY</span></a>    <span class="k">/* Unrepresentable soft limit */</span>
<a name="299" /><span class="True">     299:</span> 
<a name="300" /><span class="True">     300:</span> <span class="k">/*</span>
<a name="301" /><span class="True">     301:</span> <span class="k"> * Possible values of the first parameter to getrlimit()/setrlimit(), to</span>
<a name="302" /><span class="True">     302:</span> <span class="k"> * indicate for which resource the operation is being performed.</span>
<a name="303" /><span class="True">     303:</span> <span class="k"> */</span>
<a name="304" /><span class="True">     304:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX0NQVV8w"><span class="b">RLIMIT_CPU</span></a>    <span class="c">0</span>        <span class="k">/* cpu time per process */</span>
<a name="305" /><span class="True">     305:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX0ZTSVpFXzA_"><span class="b">RLIMIT_FSIZE</span></a>    <span class="c">1</span>        <span class="k">/* file size */</span>
<a name="306" /><span class="True">     306:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX0RBVEFfMA__"><span class="b">RLIMIT_DATA</span></a>    <span class="c">2</span>        <span class="k">/* data segment size */</span>
<a name="307" /><span class="True">     307:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX1NUQUNLXzA_"><span class="b">RLIMIT_STACK</span></a>    <span class="c">3</span>        <span class="k">/* stack size */</span>
<a name="308" /><span class="True">     308:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX0NPUkVfMA__"><span class="b">RLIMIT_CORE</span></a>    <span class="c">4</span>        <span class="k">/* core file size */</span>
<a name="309" /><span class="True">     309:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX0FTXzA_"><span class="b">RLIMIT_AS</span></a>    <span class="c">5</span>        <span class="k">/* address space (resident set size) */</span>
<a name="310" /><span class="True">     310:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="311" /><span class="True">     311:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX1JTU18w"><span class="b">RLIMIT_RSS</span></a>    <a href="macros_noref.html#_UkxJTUlUX0FTXzA_"><span class="b">RLIMIT_AS</span></a>    <span class="k">/* source compatibility alias */</span>
<a name="312" /><span class="True">     312:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX01FTUxPQ0tfMA__"><span class="b">RLIMIT_MEMLOCK</span></a>    <span class="c">6</span>        <span class="k">/* locked-in-memory address space */</span>
<a name="313" /><span class="True">     313:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX05QUk9DXzA_"><span class="b">RLIMIT_NPROC</span></a>    <span class="c">7</span>        <span class="k">/* number of processes */</span>
<a name="314" /><span class="True">     314:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="315" /><span class="True">     315:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX05PRklMRV8w"><span class="b">RLIMIT_NOFILE</span></a>    <span class="c">8</span>        <span class="k">/* number of open files */</span>
<a name="316" /><span class="True">     316:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="317" /><span class="True">     317:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTV9OTElNSVRTXzA_"><span class="b">RLIM_NLIMITS</span></a>    <span class="c">9</span>        <span class="k">/* total number of resource limits */</span>
<a name="318" /><span class="True">     318:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="319" /><span class="True">     319:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1JMSU1JVF9QT1NJWF9GTEFHXzA_"><span class="b">_RLIMIT_POSIX_FLAG</span></a>    <span class="c">0x1000</span>    <span class="k">/* Set bit for strict POSIX */</span>
<a name="320" /><span class="True">     320:</span> 
<a name="321" /><span class="True">     321:</span> <span class="k">/*</span>
<a name="322" /><span class="True">     322:</span> <span class="k"> * A structure representing a resource limit.  The address of an instance</span>
<a name="323" /><span class="True">     323:</span> <span class="k"> * of this structure is the second parameter to getrlimit()/setrlimit().</span>
<a name="324" /><span class="True">     324:</span> <span class="k"> */</span>
<a name="325" /><span class="True">     325:</span> <span class="m">struct</span> <span class="b">rlimit</span> <span class="f">{</span>
<a name="326" /><span class="True">     326:</span>     <span class="b">rlim_t</span>    <span class="b">rlim_cur</span><span class="f">;</span>        <span class="k">/* current (soft) limit */</span>
<a name="327" /><span class="True">     327:</span>     <span class="b">rlim_t</span>    <span class="b">rlim_max</span><span class="f">;</span>        <span class="k">/* maximum value for rlim_cur */</span>
<a name="328" /><span class="True">     328:</span> <span class="f">}</span><span class="f">;</span>
<a name="329" /><span class="True">     329:</span> 
<a name="330" /><span class="True">     330:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="331" /><span class="True">     331:</span> <span class="k">/*</span>
<a name="332" /><span class="True">     332:</span> <span class="k"> * proc_rlimit_control()</span>
<a name="333" /><span class="True">     333:</span> <span class="k"> *</span>
<a name="334" /><span class="True">     334:</span> <span class="k"> * Resource limit flavors</span>
<a name="335" /><span class="True">     335:</span> <span class="k"> */</span>
<a name="336" /><span class="True">     336:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UkxJTUlUX1dBS0VVUFNfTU9OSVRPUl8w"><span class="b">RLIMIT_WAKEUPS_MONITOR</span></a>        <span class="c">0x1</span> <span class="k">/* Configure the wakeups monitor. */</span>
<a name="337" /><span class="True">     337:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX0NQVV9VU0FHRV9NT05JVE9SXzA_"><span class="b">RLIMIT_CPU_USAGE_MONITOR</span></a>    <span class="c">0x2</span> <span class="k">/* Configure the CPU usage monitor. */</span>
<a name="338" /><span class="True">     338:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_UkxJTUlUX1RIUkVBRF9DUFVMSU1JVFNfMA__"><span class="b">RLIMIT_THREAD_CPULIMITS</span></a>        <span class="c">0x3</span> <span class="k">/* Configure a blocking, per-thread, CPU limits. */</span>
<a name="339" /><span class="True">     339:</span> 
<a name="340" /><span class="True">     340:</span> <span class="k">/*</span>
<a name="341" /><span class="True">     341:</span> <span class="k"> * Flags for wakeups monitor control.</span>
<a name="342" /><span class="True">     342:</span> <span class="k"> */</span>
<a name="343" /><span class="True">     343:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_V0FLRU1PTl9FTkFCTEVfMA__"><span class="b">WAKEMON_ENABLE</span></a>            <span class="c">0x01</span>
<a name="344" /><span class="True">     344:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_V0FLRU1PTl9ESVNBQkxFXzA_"><span class="b">WAKEMON_DISABLE</span></a>            <span class="c">0x02</span>
<a name="345" /><span class="True">     345:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_V0FLRU1PTl9HRVRfUEFSQU1TXzA_"><span class="b">WAKEMON_GET_PARAMS</span></a>        <span class="c">0x04</span>
<a name="346" /><span class="True">     346:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_V0FLRU1PTl9TRVRfREVGQVVMVFNfMA__"><span class="b">WAKEMON_SET_DEFAULTS</span></a>        <span class="c">0x08</span>
<a name="347" /><span class="True">     347:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_V0FLRU1PTl9NQUtFX0ZBVEFMXzA_"><span class="b">WAKEMON_MAKE_FATAL</span></a>        <span class="c">0x10</span> <span class="k">/* Configure the task so that violations are fatal. */</span>
<a name="348" /><span class="True">     348:</span> <span class="k">/*</span>
<a name="349" /><span class="True">     349:</span> <span class="k"> * Flags for CPU usage monitor control.</span>
<a name="350" /><span class="True">     350:</span> <span class="k"> */</span>
<a name="351" /><span class="True">     351:</span> <span class="f">#</span><span class="n">define</span>    <a href="macros_noref.html#_Q1BVTU9OX01BS0VfRkFUQUxfMA__"><span class="b">CPUMON_MAKE_FATAL</span></a>        <span class="c">0x1000</span>
<a name="352" /><span class="True">     352:</span> 
<a name="353" /><span class="True">     353:</span> <span class="m">struct</span> <span class="b">proc_rlimit_control_wakeupmon</span> <span class="f">{</span>
<a name="354" /><span class="True">     354:</span>     <span class="b">uint32_t</span> <span class="b">wm_flags</span><span class="f">;</span>
<a name="355" /><span class="True">     355:</span>     <span class="b">int32_t</span> <span class="b">wm_rate</span><span class="f">;</span>
<a name="356" /><span class="True">     356:</span> <span class="f">}</span><span class="f">;</span>
<a name="357" /><span class="True">     357:</span> 
<a name="358" /><span class="True">     358:</span> <span class="k">/* I/O type */</span>
<a name="359" /><span class="True">     359:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfVFlQRV9ESVNLXzA_"><span class="b">IOPOL_TYPE_DISK</span></a>    <span class="c">0</span>
<a name="360" /><span class="True">     360:</span> 
<a name="361" /><span class="True">     361:</span> <span class="k">/* scope */</span>
<a name="362" /><span class="True">     362:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfU0NPUEVfUFJPQ0VTU18w"><span class="b">IOPOL_SCOPE_PROCESS</span></a>   <span class="c">0</span>
<a name="363" /><span class="True">     363:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfU0NPUEVfVEhSRUFEXzA_"><span class="b">IOPOL_SCOPE_THREAD</span></a>    <span class="c">1</span>
<a name="364" /><span class="True">     364:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfU0NPUEVfREFSV0lOX0JHXzA_"><span class="b">IOPOL_SCOPE_DARWIN_BG</span></a> <span class="c">2</span>
<a name="365" /><span class="True">     365:</span> 
<a name="366" /><span class="True">     366:</span> <span class="k">/* I/O Priority */</span>
<a name="367" /><span class="True">     367:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfREVGQVVMVF8w"><span class="b">IOPOL_DEFAULT</span></a>        <span class="c">0</span>
<a name="368" /><span class="True">     368:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfSU1QT1JUQU5UXzA_"><span class="b">IOPOL_IMPORTANT</span></a>        <span class="c">1</span>
<a name="369" /><span class="True">     369:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfUEFTU0lWRV8w"><span class="b">IOPOL_PASSIVE</span></a>        <span class="c">2</span>
<a name="370" /><span class="True">     370:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfVEhST1RUTEVfMA__"><span class="b">IOPOL_THROTTLE</span></a>        <span class="c">3</span>
<a name="371" /><span class="True">     371:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfVVRJTElUWV8w"><span class="b">IOPOL_UTILITY</span></a>        <span class="c">4</span>
<a name="372" /><span class="True">     372:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfU1RBTkRBUkRfMA__"><span class="b">IOPOL_STANDARD</span></a>        <span class="c">5</span>
<a name="373" /><span class="True">     373:</span> 
<a name="374" /><span class="True">     374:</span> <span class="k">/* compatibility with older names */</span>
<a name="375" /><span class="True">     375:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfQVBQTElDQVRJT05fMA__"><span class="b">IOPOL_APPLICATION</span></a>       <a href="macros_noref.html#_SU9QT0xfU1RBTkRBUkRfMA__"><span class="b">IOPOL_STANDARD</span></a>
<a name="376" /><span class="True">     376:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_SU9QT0xfTk9STUFMXzA_"><span class="b">IOPOL_NORMAL</span></a>            <a href="macros_noref.html#_SU9QT0xfSU1QT1JUQU5UXzA_"><span class="b">IOPOL_IMPORTANT</span></a>
<a name="377" /><span class="True">     377:</span> 
<a name="378" /><span class="True">     378:</span> 
<a name="379" /><span class="True">     379:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="380" /><span class="True">     380:</span> 
<a name="381" /><span class="True">     381:</span> 
<a name="382" /><span class="True">     382:</span> <a href="macros_ref.html#_X19CRUdJTl9ERUNMU18w"><span class="b">__BEGIN_DECLS</span></a>
<a name="383" /><span class="True">     383:</span> <span class="m">int</span>    <span class="b">getpriority</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="b">id_t</span><span class="f">)</span><span class="f">;</span>
<a name="384" /><span class="True">     384:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="385" /><span class="True">     385:</span> <span class="m">int</span>    <span class="b">getiopolicy_np</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span> <a href="macros_ref.html#_X19PU1hfQVZBSUxBQkxFX1NUQVJUSU5HXzA_"><span class="b">__OSX_AVAILABLE_STARTING</span></a><span class="f">(</span><a href="macros_ref.html#_X19NQUNfMTBfNV8w"><span class="b">__MAC_10_5</span></a><span class="f">,</span> <a href="macros_ref.html#_X19JUEhPTkVfMl8wXzA_"><span class="b">__IPHONE_2_0</span></a><span class="f">)</span><span class="f">;</span>
<a name="386" /><span class="True">     386:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="387" /><span class="True">     387:</span> <span class="m">int</span>    <span class="b">getrlimit</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="m">struct</span> <span class="b">rlimit</span> <span class="f">*</span><span class="f">)</span> <a href="macros_ref.html#_X19EQVJXSU5fQUxJQVNfMA__"><span class="b">__DARWIN_ALIAS</span></a><span class="f">(</span><span class="b">getrlimit</span><span class="f">)</span><span class="f">;</span>
<a name="388" /><span class="True">     388:</span> <span class="m">int</span>    <span class="b">getrusage</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="m">struct</span> <span class="b">rusage</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="389" /><span class="True">     389:</span> <span class="m">int</span>    <span class="b">setpriority</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="b">id_t</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="390" /><span class="True">     390:</span> <span class="f">#</span><span class="n">if</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19MRVZFTF8w"><span class="b">__DARWIN_C_LEVEL</span></a> <span class="f">&gt;=</span> <a href="macros_ref.html#_X19EQVJXSU5fQ19GVUxMXzA_"><span class="b">__DARWIN_C_FULL</span></a>
<a name="391" /><span class="True">     391:</span> <span class="m">int</span>    <span class="b">setiopolicy_np</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="m">int</span><span class="f">,</span> <span class="m">int</span><span class="f">)</span> <a href="macros_ref.html#_X19PU1hfQVZBSUxBQkxFX1NUQVJUSU5HXzA_"><span class="b">__OSX_AVAILABLE_STARTING</span></a><span class="f">(</span><a href="macros_ref.html#_X19NQUNfMTBfNV8w"><span class="b">__MAC_10_5</span></a><span class="f">,</span> <a href="macros_ref.html#_X19JUEhPTkVfMl8wXzA_"><span class="b">__IPHONE_2_0</span></a><span class="f">)</span><span class="f">;</span>
<a name="392" /><span class="True">     392:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __DARWIN_C_LEVEL &gt;= __DARWIN_C_FULL */</span>
<a name="393" /><span class="True">     393:</span> <span class="m">int</span>    <span class="b">setrlimit</span><span class="f">(</span><span class="m">int</span><span class="f">,</span> <span class="m">const</span> <span class="m">struct</span> <span class="b">rlimit</span> <span class="f">*</span><span class="f">)</span> <a href="macros_ref.html#_X19EQVJXSU5fQUxJQVNfMA__"><span class="b">__DARWIN_ALIAS</span></a><span class="f">(</span><span class="b">setrlimit</span><span class="f">)</span><span class="f">;</span>
<a name="394" /><span class="True">     394:</span> <a href="macros_ref.html#_X19FTkRfREVDTFNfMA__"><span class="b">__END_DECLS</span></a>
<a name="395" /><span class="True">     395:</span> 
<a name="396" /><span class="True">     396:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* !_SYS_RESOURCE_H_ */</span>
<a name="397" /><span class="True">     397:</span> </pre>
  </body>
</html>
